<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Edit Project</title>
</head>

<script src="dist/js/jquery-1.9.1.min.js"></script>
<script src="dist/js/jquery.validate.min.js"></script>
<script src="dist/js/project-validation.js"></script>
<body>
	<div class="container" style="height: 410px;">
		<table>
			<tr>
				<td valign="top">
					<form action="editProject.action" id="projectForm"
						name="editProject">
						<table>
							<tr>
								<td>
									<h4>Project Name :</h4>
								</td>
								<td><input type="text" class="form-control"
									value="${session.selectedProject.projectName}"
									placeholder="Project Name" id="project_name"
									name="project_name"></td>
								<td><label class="error" for="project_name"
									style="color: red" generated="true"></label></td>
							</tr>
							<tr>
								<td><h4>Project Agreement :</h4></td>
								<td><input type="text" class="form-control"
									value="${session.selectedProject.agreement}"
									placeholder="Project Agreement" id="project_agr"
									name="project_agr"></td>
								<td><label class="error" for="project_agr" generated="true"
									style="color: red"></label></td>
							</tr>
							<tr>
								<td></td>
								<td><button class="btn btn-sm btn-primary btn-block"
										type="submit">Update</button></td>
							</tr>
						</table>
					</form>
				</td>
			</tr>
		</table>
	</div>
</body>

<script>
	$(function() {
		$("#editProject").validate({
			rules : {
				project_name : "required",
				project_agr : "required",
			},
			// Specify the validation error messages
			messages : {
				project_name : "Please enter project name",
				project_agr : "Please enter project agreement",
			},
			submitHandler : function(form) {
				form.submit();
			}
		});
	});
</script>
</html>